package com.xxx.video.commen.presenters;

import android.os.Bundle;

import androidx.annotation.IdRes;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public interface ICommonBaseView {
    /**
     * get Content layout
     *
     * @return layout id
     */
    int getContentLayout();

    /**
     * get load error layout
     *
     * @return layout id
     */
    int getErrorLayout();

    /**
     * get loading layout
     *
     * @return layout id
     */
    int getLoadingLayout();

    /**
     * get no data layout
     *
     * @return layout id
     */
    int getNoDataLayout();

    /**
     * init data
     *
     * @param extras data
     */
    void initData(Bundle extras);

    /**
     * init toolbar(if you want use it,please create it)
     */
    void initToolbarData();

    /**
     * is open EventBus
     *
     * @return true open false close
     */
    boolean isOpenEventBus();

    /**
     * bind presenter(if you used it,please create it )
     */
    void bindPresenter();

    /**
     * unbind presenter
     */
    void unBindPresenter();

    /**
     * is use multi layer layout
     *
     * @return is use
     */
    boolean isUseMultiLayerLayout();

    /**
     * start other activity
     *
     * @param clazz activity.class
     */
    void intent2Activity(Class clazz);

    /**
     * start other activity with bundle
     *
     * @param clazz  activity.class
     * @param bundle data
     */
    void intent2Activity(Class clazz, Bundle bundle);

    /**
     * start other activity will have result data
     *
     * @param clazz       activity.class
     * @param requestCode request code
     */
    void intent2Activity(Class clazz, int requestCode);

    /**
     * start other activity with bundle and will have result data
     *
     * @param clazz       acitivity.class
     * @param bundle      data
     * @param requestCode request code
     */
    void intent2Activity(Class clazz, Bundle bundle, int requestCode);

    /**
     * show a fragment
     *
     * @param fragment fragment
     */
    void showFragment(Fragment fragment);

    /**
     * hide a fragment
     *
     * @param fragment fragment
     */
    void hideFragment(Fragment fragment);

    /**
     * add a fragment
     *
     * @param containerViewId fragment root view id
     * @param fragment        fragment
     * @param tag             tag name
     */
    void addFragment(@IdRes int containerViewId, Fragment fragment, @Nullable String tag);

    /**
     * replace fragment
     *
     * @param containerViewId fragment root view id
     * @param fragment        fragment
     */
    void replaceFragment(@IdRes int containerViewId, Fragment fragment);

    /**
     * show not same layout
     *
     * @param showState 0:loading view, 1:content view, 2 empty data view, 3 load data error
     */
    void showLayoutStatus(int showState);

    /**
     * refresh data
     * @param extras data
     */
    void refreshData(Bundle extras);
}
